using System;

namespace MH.WsdlWorks.ProjectModel
{
    public static class BuildUtility
    {
        public static BuildEngine InitializeBuildEngine(BuildEngine buildEngine, IServiceProvider serviceProvider)
        {
            if (buildEngine == null)
            {
                buildEngine = new BuildEngine();
            }
            return buildEngine;
        }

        public static BuildProject ReinitializeMsBuildProject(
            BuildEngine buildEngine,
            string fullProjectPath,
            BuildProject existingBuildProject)
        {
            if (existingBuildProject == null)
            {
                existingBuildProject = new BuildProject(buildEngine);
                existingBuildProject.Load(fullProjectPath);
            }
            return existingBuildProject;
        }
    }
}
